﻿using UnityEngine;
using System.Collections;

public class _Noite : MonoBehaviour {

	void Awake()
	{	
		this.transform.Translate(3.0f,0.0f,0.0f);	
	}
	
	void Start () 
	{		
		int id = 78;
		
		this.gameObject.AddComponent("MeshRenderer");
		this.gameObject.AddComponent("MeshFilter");

		Mesh mesh = Quad.Create(1.5f, 1.5f);
		
		this.gameObject.GetComponent<MeshFilter>().mesh = mesh;
		this.gameObject.GetComponent<MeshRenderer>().material = AtlasManager.globalMaterial;
		
		this.gameObject.GetComponent<MeshFilter>().mesh.uv = new Vector2[]
		{
			new Vector2(AtlasManager.rects[id].xMin, AtlasManager.rects[id].yMax),
			new Vector2(AtlasManager.rects[id].xMax, AtlasManager.rects[id].yMax),
			new Vector2(AtlasManager.rects[id].xMax, AtlasManager.rects[id].yMin),
			new Vector2(AtlasManager.rects[id].xMin, AtlasManager.rects[id].yMin)
		};
	}
	
	void Update () 
	{
	}
		
	void OnMouseDown() 
	{
		Debug.Log("Noite");
	}
}
